import {
  Body,
  Controller,
  Delete,
  Get,
  Param,
  Patch,
  Post,
} from '@nestjs/common';
import { SceneBondScriptService } from './scene_bond_script.service';
import { CreateSceneBondScriptDto } from './dto/create-scene_bond_script.dto';
import { UpdateSceneBondScriptDto } from './dto/update-scene_bond_script.dto';

@Controller('scene-bond-script')
export class SceneBondScriptController {
  constructor(
    private readonly sceneBondScriptService: SceneBondScriptService,
  ) {}

  @Post('createBond')
  createBond(@Body() createSceneBondScriptDto: CreateSceneBondScriptDto) {
    return this.sceneBondScriptService.createBond(createSceneBondScriptDto);
  }

  @Get('getBondBySceneuuid/:sceneuuid')
  getBondBySceneuuid(@Param('sceneuuid') sceneuuid: string) {
    return this.sceneBondScriptService.getBondBySceneuuid(sceneuuid);
  }

  @Get('getBondByScriptuuid/:scriptuuid')
  getBondByScriptuuid(@Param('scriptuuid') scriptuuid: string) {
    return this.sceneBondScriptService.getBondByScriptuuid(scriptuuid);
  }

  @Patch('updateBond/:id')
  updateBond(
    @Param('id') id: string,
    @Body() updateSceneBondScriptDto: UpdateSceneBondScriptDto,
  ) {
    return this.sceneBondScriptService.updateBond(id,updateSceneBondScriptDto);
  }

  @Delete('deleteBond/:id')
  deleteBond(@Param('id') id: string) {
    return this.sceneBondScriptService.deleteBond(id);
  }
}
